package io.sage.modules.sys.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.plugins.Page;

import io.sage.common.utils.PageUtils;
import io.sage.modules.exam.entity.Examination;
import io.sage.modules.sys.dao.SysRotationchartMapper;
import io.sage.modules.sys.entity.SysRotationchart;
import io.sage.modules.sys.service.SysRotationchartService;

/**
 * 轮播图的服务
 * @author xujh
 */
@Service("sysRotationchartService")
public class SysRotationchartServiceImpl implements SysRotationchartService {
	@Autowired
	private SysRotationchartMapper rotationchartMapper;
	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		
		Integer limit = Integer.parseInt((String)params.get("limit"));
    	Integer pageNum = Integer.parseInt((String)params.get("page"));
		
		Page<Examination> page = new Page<>(pageNum,limit);
		
		page.setRecords(rotationchartMapper.selectRotationchartList(page, params));
		return new PageUtils(page);
	}

	@Override
	public int insert(SysRotationchart rotationchart) {
		
		rotationchart.setCreateTime(new Date());
		
		return rotationchartMapper.insertSelective(rotationchart);
	}

	@Override
	public SysRotationchart selectById(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateAllColumnById(SysRotationchart sysRotationchart) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteBatchIds(List<Integer> asList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<SysRotationchart> selectRotationchart(Map<String, Object> params) {
		
		return rotationchartMapper.selectRotationchartList(params);
	}

}
